package com.shj.em;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@SpringBootApplication
public class EmApplication extends SpringBootServletInitializer {

    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(EmApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(EmApplication.class, args);
    }

    @GetMapping("/")
    String home() {
        return "redirect:index";
    }

    @RequestMapping("/error/500")
    String error500(){
        return "/error/500";
    }

    @RequestMapping("/error/404")
    String error404(){
        return "/error/404";
    }


}

